/*
 * Copyright (c) 2013. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
 * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
 * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
 * Vestibulum commodo. Ut rhoncus gravida arcu.
 */

package com.ms.qw.domain.support;

public abstract class Validator<T> {
    protected T entity;

    private ValidationNotificationHandler notificationHandler;

    public Validator(T entity, ValidationNotificationHandler aHandler) {
        super();
        this.setNotificationHandler(aHandler);
        this.setEntity(entity);
    }
    public abstract void validate();

    protected ValidationNotificationHandler notificationHandler() {
        return this.notificationHandler;
    }

    private void setNotificationHandler(ValidationNotificationHandler aHandler) {
        this.notificationHandler = aHandler;
    }

    public void setEntity(T entity) {
        this.entity = entity;
    }
}
